#include<iostream>
#include<vector>

using namespace std;

int gcd(int a, int b){
	return b?gcd(b,a%b):a;
}

int main(){
	int cnt[10000]={0};
	int n;
	cin>>n;
	vector<int> deck(n);
	for(int i=0;i<n;i++){
		cin>>deck[i];
		cnt[deck[i]]++;
	}
	
    int g = -1;
    for (int i = 0; i < 10000; ++i) {
        if (cnt[i]) {
            if (~g) {
                g = gcd(g, cnt[i]);
            } else {
                g = cnt[i];
            }
        }
    }
    
    if(g >= 2){
    	cout<<"true";
	}else{
		cout<<"false";
	}

    return 0;
} 

